package com.archer;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.XMLConfiguration;

/**
 * Created by 0979 on 14-1-8.
 */
public class ConfigHolder {
    private static final String CONFIG_FILE = "app-config/const-config.xml";

    private ConfigHolder() {
    }

    private static Configuration config = null;

    public static synchronized Configuration getConfig() {
        try {
            if (config == null) {
                config = new XMLConfiguration(CONFIG_FILE);
            }
        } catch (ConfigurationException e) {
            e.printStackTrace();
        }
        return config;
    }
}
